// @ts-ignore
/* eslint-disable */
import request from "@/utils/http";

/** 管理员踢人接口 POST /api/monitor/${param0}/kick */
export async function kickUser(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.kickUserParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<Api.Result1Boolean>(`/api/monitor/${param0}/kick`, {
    method: "POST",
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 删除日志 DELETE /api/monitor/batch/log */
export async function batchDeleteLog(
  body: Api.BatchDeleteLogCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/monitor/batch/log", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json-patch+json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除登录日志 DELETE /api/monitor/batch/online/log */
export async function batchDeleteOnlineLog(
  body: Api.BatchDeleteOnlineLogCommand,
  options?: { [key: string]: any }
) {
  return request<Api.Result1Boolean>("/api/monitor/batch/online/log", {
    method: "DELETE",
    headers: {
      "Content-Type": "application/json-patch+json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /api/monitor/heartbeat */
export async function heartbeat(options?: { [key: string]: any }) {
  return request<any>("/api/monitor/heartbeat", {
    method: "POST",
    ...(options || {}),
  });
}

/** 登录日志-分页查询 GET /api/monitor/login/log/page */
export async function queryLoginLog(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.queryLoginLogParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1OnlineUserDto>(
    "/api/monitor/login/log/page",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 我的登录日志 GET /api/monitor/me/login/log/page */
export async function queryMeLoginLog(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.queryMeLoginLogParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1OnlineUserDto>(
    "/api/monitor/me/login/log/page",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 操作日志-分页查询 GET /api/monitor/operation/log/page */
export async function queryOperationLogs(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.queryOperationLogsParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1SystemLogDto>(
    "/api/monitor/operation/log/page",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 在线用户-分页查询 GET /api/monitor/page */
export async function queryOnlineUsers(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.queryOnlineUsersParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1OnlineUserDto>("/api/monitor/page", {
    method: "GET",
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** SSE 订阅事件 GET /api/monitor/subscribe */
export async function subscribe(options?: { [key: string]: any }) {
  return request<any>("/api/monitor/subscribe", {
    method: "GET",
    ...(options || {}),
  });
}

/** 系统日志-分页查询 GET /api/monitor/system/log/page */
export async function querySystemLogs(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: Api.querySystemLogsParams,
  options?: { [key: string]: any }
) {
  return request<Api.Result1PaginatedData1SystemLogDto>(
    "/api/monitor/system/log/page",
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 同步日志 POST /api/monitor/tenant/log/sync */
export async function tenantLogSync(options?: { [key: string]: any }) {
  return request<Api.Result1Boolean>("/api/monitor/tenant/log/sync", {
    method: "POST",
    ...(options || {}),
  });
}
